<template>
	<view class="">
		<view @click="leftClick()" class="leftButton fixed-top ">
			<u-icon name="arrow-left" color="white" size="26"></u-icon>
		</view>
		<image class="BGImage1" src="/static/share/bg2.png" mode=""></image>


		<view class="fixed-top flex-column-center">
			<image class="logoImage" src="../../../static/share/logo.png" mode=""></image>
			<view class="title flex-column-center">
				<text>爱尚陪玩是一家提供线下高端定制私人达人服务信息平台。</text>
				<text>支持筛选同城、附近、全国达人服务信息预约。</text>
				<text>爽约包赔，安全便捷，诚信经营。</text>
			</view>
			<image class="codeImage" :src="user.intive_code" mode=""></image>
			<view @click="copyText" class="button flex-row-center">
				立即分享
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: '',
				nodes: ''
			}
		},
		onLoad() {
			this.user = uni.getStorageSync('user')
			this.init()
			this.text()
		},
		methods: {
			init() {
				// 获取个人信息
				this.$http.post('api/user/detail').then(res => {
					uni.setStorageSync('user', res)
					this.user = uni.getStorageSync('user')
				});


			},
			leftClick() {
				console.log('返回按钮点击')
				uni.navigateBack()
			},
			copyText() {
				uni.setClipboardData({
					data: this.user.invite_url,
					success: function() {
						uni.showToast({
							title: '链接已复制',
							duration: 2000,
						});
					}
				})
			},
			text() {
				this.$http.post('api/sys/article', {
					id: 10
				}).then(res => {
					this.nodes = res.content;
					console.log(res);
				})
			}


		}
	}
</script>

<style scoped lang="less">
	.BGImage1 {
		position: fixed;
		width: 100%;
		height: 100%;
		bottom: 0;
		top: 0;
		left: 0;
		z-index: 2;
	}

	.logoImage {
		margin-top: 136rpx;
		width: 230rpx;
		height: 230rpx;
	}

	.title {
		margin-top: 40rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		color: #FFFFFF;
	}

	.codeImage {
		margin-top: 50rpx;
		width: 312rpx;
		height: 312rpx;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		border: 20rpx;
		opacity: 1;
		border: 14rpx solid #FFFFFF;
	}

	.button {
		margin: 124rpx;
		width: 686rpx;
		height: 84rpx;
		background: #FFFFFF;
		border-radius: 82rpx 82rpx 82rpx 82rpx;
		opacity: 1;
		font-size: 32rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #C74BF0;
	}
</style>